package tests;

import junit.framework.TestCase;
import modele.modelesdelangage.FabriqueModeleDeLangage;
import modele.modelesdelangage.ModeleDeLangage;

public class TestModeleArpa extends TestCase 
{
	ModeleDeLangage mdl;
	
	public TestModeleArpa()
	{
		FabriqueModeleDeLangage fmdl = new FabriqueModeleDeLangage();
		mdl = FabriqueModeleDeLangage.creerModeleDeLangage("data/ML_3-gram_JEP-2002-2004-2008.arpa", "categorie test") ;	
	}

	/** Vocation de la classe
	 * Classe de test du package modeleDeLangage
	 */
	public void testCreationModele() 
	{				
		assertNotNull(mdl);
	}
	
	public void testProbabilite()
	{
		//float proba = mdl.getProbabilite("centre", "le", "dont") ;
		//assertEquals(-2.379268f, proba) ; valider
		//float proba = mdl.getProbabilite("bidon","bidon","bidon") ;
		//assertEquals(1f, proba) ;
		float proba = mdl.getProbabilite("dont","cercle","le") ;
		assertEquals(-3,0130086f, proba) ;
	}

}
